package com.nbsaas.boot.app.rest.resource;

import com.nbsaas.boot.app.api.apis.AppRoleMenuApi;
import com.nbsaas.boot.app.data.entity.AppRoleMenu;
import com.nbsaas.boot.app.api.domain.request.AppRoleMenuRequest;
import com.nbsaas.boot.app.api.domain.response.AppRoleMenuResponse;
import com.nbsaas.boot.app.api.domain.simple.AppRoleMenuSimple;
import com.nbsaas.boot.app.rest.convert.AppRoleMenuSimpleConvert;
import com.nbsaas.boot.app.rest.convert.AppRoleMenuEntityConvert;
import com.nbsaas.boot.app.rest.convert.AppRoleMenuResponseConvert;
import com.nbsaas.boot.app.data.repository.AppRoleMenuRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class AppRoleMenuResource extends BaseResource<AppRoleMenu,AppRoleMenuResponse, AppRoleMenuSimple, AppRoleMenuRequest>  implements AppRoleMenuApi {

    @Resource
    private AppRoleMenuRepository appRoleMenuRepository;

    @Override
    public JpaRepositoryImplementation<AppRoleMenu, Serializable> getJpaRepository() {
        return appRoleMenuRepository;
    }

    @Override
    public Function<AppRoleMenu, AppRoleMenuSimple> getConvertSimple() {
        return new AppRoleMenuSimpleConvert();
    }

    @Override
    public Function<AppRoleMenuRequest, AppRoleMenu> getConvertForm() {
        return new AppRoleMenuEntityConvert();
    }

    @Override
    public Function<AppRoleMenu, AppRoleMenuResponse> getConvertResponse() {
        return new AppRoleMenuResponseConvert();
    }




}


